<html>
<head><meta charset="utf-8"><title>Box with allocator · t-libs/wg-allocators · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/index.html">t-libs/wg-allocators</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html">Box with allocator</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="164771258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164771258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tim Diekmann <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164771258">(May 03 2019 at 06:26)</a>:</h4>
<p>We should continue the discussion about <code>Box</code> here <span class="user-mention" data-user-id="220510">@Mike Hommey</span> :)</p>



<a name="164771296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164771296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164771296">(May 03 2019 at 06:27)</a>:</h4>
<p>Yes, that would be more effective than github.</p>



<a name="164771443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164771443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tim Diekmann <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164771443">(May 03 2019 at 06:31)</a>:</h4>
<p>Do you want to create a new PR btw? There has to be changed quiet a bit. </p>
<p>Yes, I'm very excited about progressing on this :D</p>



<a name="164771800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164771800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164771800">(May 03 2019 at 06:40)</a>:</h4>
<p>Not sure about a new PR. Has your <code>DispatchFromDyn</code> stuff been merged yet?</p>



<a name="164771872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164771872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tim Diekmann <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164771872">(May 03 2019 at 06:42)</a>:</h4>
<p>Yes, it's merged</p>



<a name="164771957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164771957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164771957">(May 03 2019 at 06:44)</a>:</h4>
<p>Aha! Let me refresh my patch right away, then.</p>



<a name="164775121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164775121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164775121">(May 03 2019 at 08:00)</a>:</h4>
<p>Still getting</p>
<div class="codehilite"><pre><span></span>error[E0378]: the trait `DispatchFromDyn` may only be implemented for structs containing the field being coerced, `PhantomData` fields, and nothing else
</pre></div>


<p>on master, with </p>
<div class="codehilite"><pre><span></span>impl&lt;T: ?Sized + Unsize&lt;U&gt;, U: ?Sized&gt; DispatchFromDyn&lt;Box&lt;U&gt;&gt; for Box&lt;T&gt; {}
</pre></div>



<a name="164775707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164775707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tim Diekmann <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164775707">(May 03 2019 at 08:10)</a>:</h4>
<p>Did you pull the latest master?</p>



<a name="164775712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164775712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tim Diekmann <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164775712">(May 03 2019 at 08:10)</a>:</h4>
<p>AFAIK it was merged yesterday after dozens of rerolls</p>



<a name="164775792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164775792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164775792">(May 03 2019 at 08:12)</a>:</h4>
<p>I'm on <a href="https://github.com/rust-lang/rust/commit/08bfe16129b0621bc90184f8704523d4929695ef" target="_blank" title="https://github.com/rust-lang/rust/commit/08bfe16129b0621bc90184f8704523d4929695ef">08bfe16129b0621bc90184f8704523d4929695ef</a>.</p>



<a name="164775801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164775801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164775801">(May 03 2019 at 08:12)</a>:</h4>
<p>What was your PR?</p>



<a name="164776074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164776074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164776074">(May 03 2019 at 08:18)</a>:</h4>
<p>Facepalm, this is stage0.</p>



<a name="164776760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164776760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tim Diekmann <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164776760">(May 03 2019 at 08:31)</a>:</h4>
<p>Oh, yeah. This requires #[cfg(stage0)]. Take a look at <a href="https://github.com/TimDiekmann/rust/commit/94031fd1f3c6dc1cb48474d5144003d697660b15" target="_blank" title="https://github.com/TimDiekmann/rust/commit/94031fd1f3c6dc1cb48474d5144003d697660b15">TimDiekmann@<code>94031fd</code></a> :)</p>



<a name="164776858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164776858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164776858">(May 03 2019 at 08:33)</a>:</h4>
<p>Do you think we can get your PR uplifted to beta, so that we can update the stage0 and not have to deal with the whole "duplicate <a href="http://boxed.rs" target="_blank" title="http://boxed.rs">boxed.rs</a>" thing. Or we wait 3 more weeks...</p>



<a name="164777161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164777161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tim Diekmann <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164777161">(May 03 2019 at 08:38)</a>:</h4>
<p>I'm not familiar with the beta uplifting process. Waiting 3 more weeks is pretty much IMO.  With the duplicated <code>boxed.rs</code> it's not that much to be changed (figuring out the <code>#[cfg(...)]</code> flags with the combination of <code>test</code> and <code>stage0</code> was the hardest part).  When adding <code>// FIXME: remove this ...</code> this would be pretty straight forward to remove again, once the new stage0 compiler is used.</p>



<a name="164777309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164777309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164777309">(May 03 2019 at 08:40)</a>:</h4>
<p>Considering all the things that still aren't resolved, and the time this has been baking, it doesn't feel like 3 weeks is not going to make a very large difference to me. <span class="user-mention" data-user-id="219747">@Simon Sapin</span>, what do you think?</p>



<a name="164782482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164782482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164782482">(May 03 2019 at 10:10)</a>:</h4>
<p>I agree that it’s unlikely everything else is gonna also be resolved in three weeks</p>



<a name="164782499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164782499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164782499">(May 03 2019 at 10:10)</a>:</h4>
<p>But does this really require a new snapshot? Isn’t <code>#[cfg(not(stage0))]</code> working for this?</p>



<a name="164783589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164783589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164783589">(May 03 2019 at 10:32)</a>:</h4>
<p>Virtually everything in <a href="http://boxed.rs" target="_blank" title="http://boxed.rs">boxed.rs</a> needs to be duplicated for <code>stage0</code>/<code>not(stage0)</code>, plus a few other things (like <code>box_free</code>, the some things in <code>rc.rs</code>, etc.)</p>



<a name="164784577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164784577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164784577">(May 03 2019 at 10:52)</a>:</h4>
<p>Dammit, I had an idea for stage0 that could require less changes, but the base of it doesn't work... <a href="https://play.rust-lang.org/?version=beta&amp;mode=debug&amp;edition=2018&amp;gist=e5025d6663e4db30f8084ec224e7c517" target="_blank" title="https://play.rust-lang.org/?version=beta&amp;mode=debug&amp;edition=2018&amp;gist=e5025d6663e4db30f8084ec224e7c517">https://play.rust-lang.org/?version=beta&amp;mode=debug&amp;edition=2018&amp;gist=e5025d6663e4db30f8084ec224e7c517</a><br>
despite the type definitely being a <code>PhantomData</code>...<br>
it works on nightly... fun...</p>



<a name="164784758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164784758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164784758">(May 03 2019 at 10:56)</a>:</h4>
<p>this doesn't work either:<br>
<a href="https://play.rust-lang.org/?version=beta&amp;mode=debug&amp;edition=2018&amp;gist=aaf4b6d813686f71d43d2fc5b7527267" target="_blank" title="https://play.rust-lang.org/?version=beta&amp;mode=debug&amp;edition=2018&amp;gist=aaf4b6d813686f71d43d2fc5b7527267">https://play.rust-lang.org/?version=beta&amp;mode=debug&amp;edition=2018&amp;gist=aaf4b6d813686f71d43d2fc5b7527267</a><br>
(it does in nightly, again ; this is a frustrating game)</p>



<a name="164784880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164784880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164784880">(May 03 2019 at 10:59)</a>:</h4>
<p>so in beta, if it's not _exactly_ a PhantomData, it doesn't work. Not an associated type that resolves to a PhantomData.<br>
And a type alias that resolves to a PhantomData doesn't work either, because they can't be used as a constructor ; plus doing <code>type Global = PhantomData&lt;Foo&gt;</code> doesn't work for the <code>impl Alloc for Global</code> because <code>PhantomData</code> is not a local type.</p>



<a name="164785266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164785266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164785266">(May 03 2019 at 11:06)</a>:</h4>
<p>Ok, I have another idea that might work.</p>



<a name="164786037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164786037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164786037">(May 03 2019 at 11:22)</a>:</h4>
<p>you could have #[cfg] on modules :)</p>



<a name="164786046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164786046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164786046">(May 03 2019 at 11:22)</a>:</h4>
<p>or #[cfg_attr(stage0, path = "boxed_stage0.rs")]</p>



<a name="164786089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164786089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164786089">(May 03 2019 at 11:23)</a>:</h4>
<p>Doesn't solve the problem for the stuff that is not in <a href="http://boxed.rs" target="_blank" title="http://boxed.rs">boxed.rs</a>. But it looks like my other idea works.</p>



<a name="164790602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164790602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164790602">(May 03 2019 at 12:44)</a>:</h4>
<p>Anyone has an idea what's going on? I'm getting</p>
<div class="codehilite"><pre><span></span>error[E0038]: the trait `std::boxed::FnBox` cannot be made into an object] 3/4: test
   --&gt; src/libtest/lib.rs:176:15
    |
176 |     DynTestFn(Box&lt;dyn FnBox() + Send&gt;),
    |               ^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::boxed::FnBox` cannot be made into an object
    |
    = note: method `call_box`&#39;s receiver cannot be dispatched on

error[E0038]: the trait `std::boxed::FnBox` cannot be made into an object
    --&gt; src/libtest/lib.rs:1446:5
     |
1446 | /     fn run_test_inner(
1447 | |         desc: TestDesc,
1448 | |         monitor_ch: Sender&lt;MonitorMsg&gt;,
1449 | |         nocapture: bool,
...    |
1491 | |         }
1492 | |     }
     | |_____^ the trait `std::boxed::FnBox` cannot be made into an object
     |
     = note: method `call_box`&#39;s receiver cannot be dispatched on
</pre></div>


<p>with <a href="https://github.com/glandium/rust/commit/b4dc331198c95a77f7e7a15b58a0312791b4a564" target="_blank" title="https://github.com/glandium/rust/commit/b4dc331198c95a77f7e7a15b58a0312791b4a564">https://github.com/glandium/rust/commit/b4dc331198c95a77f7e7a15b58a0312791b4a564</a></p>



<a name="164791103"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164791103" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164791103">(May 03 2019 at 12:52)</a>:</h4>
<p><span class="user-mention" data-user-id="220510">@Mike Hommey</span> maybe the <code>Receiver</code> trait?</p>



<a name="164791132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164791132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164791132">(May 03 2019 at 12:52)</a>:</h4>
<p>Or <code>DispatchFromDyn</code>? As in, extend the impls to be allocator-generic</p>



<a name="164791228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164791228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164791228">(May 03 2019 at 12:54)</a>:</h4>
<p>That's the whole problem: DispatchFromDyn only works if the second field in Box is a ZST</p>



<a name="164791261"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164791261" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164791261">(May 03 2019 at 12:55)</a>:</h4>
<p>But yeah, it's because of the lack of generic argument to DispatchFromDyn... maybe that's the difference with Receiver that breaks it?</p>



<a name="164791265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164791265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tim Diekmann <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164791265">(May 03 2019 at 12:55)</a>:</h4>
<p>As already mentioned above, this is a working version with <code>stage0</code> cfg: <a href="https://github.com/TimDiekmann/rust/commit/94031fd1f3c6dc1cb48474d5144003d697660b15" target="_blank" title="https://github.com/TimDiekmann/rust/commit/94031fd1f3c6dc1cb48474d5144003d697660b15">TimDiekmann@<code>94031fd</code></a></p>



<a name="164791398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164791398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164791398">(May 03 2019 at 12:57)</a>:</h4>
<p>doesn't make sense</p>



<a name="164791925"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164791925" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164791925">(May 03 2019 at 13:05)</a>:</h4>
<p>mmmmm could it be related to the fact that I forgot to patch FnOnce and FnMut?</p>



<a name="164792214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164792214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164792214">(May 03 2019 at 13:09)</a>:</h4>
<p>or maybe the problem is that I _did_ patch FnBox</p>



<a name="164792336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164792336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164792336">(May 03 2019 at 13:11)</a>:</h4>
<p>yup, that was it</p>



<a name="164797842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164797842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164797842">(May 03 2019 at 14:18)</a>:</h4>
<p>Updated PR58457</p>



<a name="164810678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Box%20with%20allocator/near/164810678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tim Diekmann <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Box.20with.20allocator.html#164810678">(May 03 2019 at 16:57)</a>:</h4>
<p>I like the idea of the <code>PhantomData</code> workaround, but you shouldn't put too much effort into it, as it's just a workaround for three weeks. When duplicating <code>boxed.rs</code>, the dup can be removed without touching the file again :)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>